<template>
<!-- 总账 -->
<div>
    <div class="menuleft">
        <el-menu default-active="1" class="el-menu-vertical-demo"  @open="handleOpen" @close="handleClose">
            <el-menu-item index="1">
                <router-link to="/home">
                    <i class="icon iconfont icon-ziyuan"></i>返回首页
                </router-link>
            </el-menu-item>
            <el-submenu index="2" v-if="permissions.indexOf('期初余额')>-1">
                <template slot="title"><router-link to="/keeper"><i class="icon iconfont icon-yue"></i>&nbsp;期初余额</router-link></template>
                        <el-menu-item index="2-1" v-if="permissions.indexOf('核算项目期初录入')>-1">
                            <router-link to="/input">应收明细</router-link>
                        </el-menu-item>
                    </el-submenu>
                    <el-submenu index="3" v-if="permissions.indexOf('凭证')>-1">
                        <template slot="title">
                        <router-link to="/proof"><i class="icon iconfont icon-c-proof"></i>&nbsp;凭证</router-link>
                        </template>
                        <el-menu-item index="3-1"  v-if="permissions.indexOf('模板')>-1">
                            <router-link to="/templates">模板</router-link>
                        </el-menu-item>
                    </el-submenu>
                    <el-menu-item index="4" v-if="permissions.indexOf('账务处理')>-1">
                        <router-link to="/finance">
                            <i class="icon iconfont icon-caiwu1"></i>&nbsp;账务处理
                        </router-link>
                    </el-menu-item>
                    <el-submenu index="5" v-if="permissions.indexOf('账簿')>-1">
                        <template slot="title">
                        <i class="icon iconfont icon-zhangbu"></i>&nbsp;账簿
                        </template>
                        <el-menu-item index="5-1"  v-if="permissions.indexOf('总分类账')>-1">
                            <router-link to="/Overall">&nbsp;总分类账</router-link>
                        </el-menu-item>
                        <el-menu-item index="5-2"  v-if="permissions.indexOf('明细帐')>-1">
                            <router-link to="/Details">&nbsp;明细账</router-link>
                        </el-menu-item>
                        <el-menu-item index="5-3"  v-if="permissions.indexOf('科目余额表')>-1">
                            <router-link to="/SbjectBalanceTable">&nbsp;科目余额表</router-link>
                        </el-menu-item>
                        <el-menu-item index="5-4"  v-if="permissions.indexOf('核算明细帐')>-1">
                            <router-link to="/Checkingdt">&nbsp;核算明细帐</router-link>
                        </el-menu-item>
                        <el-menu-item index="5-5"  v-if="permissions.indexOf('员工欠款明细')>-1">
                            <router-link to="/staffArrears">&nbsp;员工欠款明细</router-link>
                        </el-menu-item>
                    </el-submenu>
                    <el-submenu index="6" v-if="permissions.indexOf('报表')>-1">
                        <template slot="title">
                            <i class="icon iconfont icon-baobiao"></i>&nbsp;报表
                        </template>
                        <el-menu-item index="6-1"  v-if="permissions.indexOf('资产负债表')>-1">
                            <router-link to="/Lose">&nbsp;资产负债表</router-link>
                        </el-menu-item>
                        <el-menu-item index="6-1"  v-if="permissions.indexOf('利润表')>-1">
                            <router-link to="/profit">&nbsp;利润表</router-link>
                        </el-menu-item>
                        <el-menu-item index="6-1"  v-if="permissions.indexOf('现金流量表')>-1">
                            <router-link to="/cash">&nbsp;现金流量表</router-link>
                        </el-menu-item>
                    </el-submenu>
                    
                </el-menu>
        </div>
        <router-view></router-view>
    </div>
</template>
<script>
import {
    mapState,
    mapGetters
} from 'vuex'
export default {
    name: "ledger",
    data() {
        return {
            activeIndex: "1",
        }
    },
    computed: {
        ...mapGetters({
            permissions: 'permissions'
        })
    },
}
</script>
<style scoped>
@import '../../common/css/index.css';
.menuleft {
    height: calc(100vh - 60px);
}
</style>
